<!--
 * @描述：【当前委托订单】
 * @作者：lichenguang
 * @时间: 2022/2/24 23:03
-->
<template>
  <div class="app-container">
    <el-table :data="tableData" style="width: 100%" border>
      <el-table-column prop="code" label="币种" align="center"></el-table-column>
      <el-table-column prop="zb" label="ZB" align="center">
        <template slot-scope="{row}">
          {{ row.zb ? row.zb : '-' }}
        </template>
      </el-table-column>
      <el-table-column prop="okx" label="OKX" align="center">
        <template slot-scope="{row}">
          {{ row.okx ? row.okx : '-' }}
        </template>
      </el-table-column>
      <el-table-column prop="upbit" label="UPBIT" align="center">
        <template slot-scope="{row}">
          {{ row.upbit ? row.upbit : '-' }}
        </template>
      </el-table-column>
      <el-table-column prop="zero" label="0点总量" align="center">
        <template slot-scope="{row}">
          {{ row.zero ? row.zero : '-' }}
        </template>
      </el-table-column>
      <el-table-column prop="total" label="持有总量" align="center">
        <template slot-scope="{row}">
          {{ row.total ? row.total : '-' }}
        </template>
      </el-table-column>
      <el-table-column prop="earnings" label="24H持仓总收益" align="center">
        <template slot-scope="{row}">
          {{ row.earnings ? row.earnings : '-' }}
        </template>
      </el-table-column>
    </el-table>
  </div>

</template>

<script>
  import {ordersNow} from '@/api/modules/account'

  export default {
    name: "OrdersNow",
    data() {
      return {
        tableData: [],
        userId: this.$route.query.userId
      }
    },
    created() {
      this.list()
    },
    methods: {
      list() {
        ordersNow({'userId': this.userId}).then(res => {
          this.tableData = res.data
        })
      }
    }
  }
</script>

<style scoped>

</style>
